package org.rslai.tcedit.domain;

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.JoinColumn;
import javax.persistence.MappedSuperclass;
import javax.persistence.OneToOne;
import org.hibernate.validator.Length;

/**
 * 测试用例修订记录
 * 
 * @author rslai
 */
@MappedSuperclass
public class TestCaseModifyNote extends UUIDSupport {

	private Version version; // 版本信息
	private String testCaseID; // 测试用例id
	private Date modifyDate; // 修订日期
	private String reason; // 修订原因
	private User user; // 用户信息（修订者 UID）

	@OneToOne
	@JoinColumn(nullable = false, updatable = true, unique = false)
	public Version getVersion() { return version; }
	public void setVersion(Version version) { this.version = version; }

	@Column(nullable = false, length = 32)
	public String getTestCaseID() { return testCaseID; }
	public void setTestCaseID(String testCaseID) { this.testCaseID = testCaseID; }

	@Column(nullable = false)
	public Date getModifyDate() { return modifyDate; }
	public void setModifyDate(Date modifyDate) { this.modifyDate = modifyDate; }

	@Column(nullable = true, length = 50)
	@Length(max = 50, message = "修订原因请限制在50字以内")
	public String getReason() { return reason; }
	public void setReason(String reason) { this.reason = reason; }

	@OneToOne
	@JoinColumn(nullable = false, updatable = true, unique = false)
	public User getUser() { return user; }
	public void setUser(User user) { this.user = user; }

}
